import request from '@/utils/request'

/**
 * 作业监控相关数据查询
 *
 * @param {*} data (无)
 * @param {*} options
 * @returns
 */
export const fetchMonitorGet = (data, options) => {
  return request({
    url: '/monitoring/getJobMonitoring',
    method: 'post',
    data,
    ...options
  })
}

/**
 * 根据人员ID查询人员信息，根据日期可查看人员任务列表，日期不传查询当天的
 *
 * @param {*} data { beginDate, endDate, id, type }
 * @param {*} options
 */
export const fetchMonitorUserList = (data, options) => {
  return request({
    url: '/monitoring/getAccRecordList',
    method: 'post',
    data,
    ...options
  })
}

/**
 * 根据车辆ID查询车辆信息与司机信息，根据日期可查看车辆任务列表，日期不传查询当天的
 *
 * @param {*} data { beginDate, endDate, id, type }
 * @param {*} options
 */
export const fetchMonitorCarList = (data, options) => {
  return request({
    url: '/monitoring/getCarRecordList',
    method: 'post',
    data,
    ...options
  })
}

/**
 * 根据道路部件ID，查询道路作业任务，可查看规定频次与实际频次
 *
 * @param {*} data { beginDate, endDate, id, type }
 * @param {*} options
 */
export const fetchMonitorPartList = (data, options) => {
  return request({
    url: '/monitoring/getComponentRecordList',
    method: 'post',
    data,
    ...options
  })
}

/**
 * 根据人员ID或车辆ID，加 时间 查询轨迹,开始结束时间都要传
 *
 * @param {*} data { beginDate, endDate, id, type }
 * @param {*} options
 */
export const fetchMonitorTrailList = (data, options) => {
  return request({
    url: '/monitoring/getCoordinateList',
    method: 'post',
    data,
    ...options
  })
}

/**
 * 根据设备ID查询摄像头实时视频地址
 *
 * @param {*} data ( deviceId )
 * @param {*} options
 */
export const fetchMonitorCamera = (data, options) => {
  return request({
    url: '/monitoring/getViod',
    method: 'post',
    data,
    ...options
  })
}
